/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package game;

import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.Spatial;
import com.jme3.scene.control.AbstractControl;
import com.jme3.scene.control.Control;

/**
 *
 * @author apple
 */
public class DamageableControl extends AbstractControl{

    private float health;
    private float maxHealth;
    private float initialHealth;
    
    public void damage(float amount, Spatial source) {
        //Calculate damage
    }
    
    public void repair(float amount) {
        //Increase health by the given amount; if health after calculation is
        //greater than maxHealth, set health to maxHealth
    }
    
    public void destroy(Spatial source) {
        //Remove the Spatial this controls from the scene graph
    }
    
    @Override
    protected void controlUpdate(float tpf) {

    }

    @Override
    protected void controlRender(RenderManager rm, ViewPort vp) {
    
    }

    public Control cloneForSpatial(Spatial spatial) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
}
